import fetch from 'utils/fetch';
/**
 * 学校管理
 */
//e学云用户分页查询
export function findEUserByPage(page,rows,sStatus,exueCode,userName,phone,userType) {
    const data = {
        sStatus,
        exueCode,
        userName,
        phone,
        userType
    };
    return fetch({
        url: '/OrgAccount/findEUserByPage/'+page+'/'+rows,
        method: 'post',
        data
    });
  }
//学校分页查询
export function findSchoolByPage(page,rows,sOrgProvince,sOrgCity,sOrgArea,responsibleName,fOrgId,responsibleNumber,sStatus) {
    const data = {
        responsibleName,
        fOrgId,
        responsibleNumber,
        sStatus,
        sOrgProvince,
        sOrgCity,
        sOrgArea,
    };
    return fetch({
        url: '/OrgAccount/findSchoolByPage/'+page+'/'+rows,
        method: 'post',
        data
    });
  }
//经销商分页查询
export function findAccountByPage(page,rows,sOrgProvince,sOrgCity,sOrgArea,responsibleName,sOrgName,responsibleNumber,sStatus) {
    const data = {
        responsibleName,
        sOrgName,
        responsibleNumber,
        sStatus,
        sOrgProvince,
        sOrgCity,
        sOrgArea,
    };
    return fetch({
        url: '/OrgAccount/findAccountByPage/'+page+'/'+rows,
        method: 'post',
        data
    });
  }
//用户状态修改
export function updateStatus(sStatus,fOrgId,fOrgType) {
    const data = {
        sStatus,
        fOrgId,
        fOrgType
    };
    return fetch({
        url: '/OrgAccount/updateStatus',
        method: 'post',
        data
    });
  }

//exue用户状态修改
export function updateEStatus(sStatus,id) {
    const data = {
        sStatus,
        id
    };
    return fetch({
        url: '/OrgAccount/updateEStatus',
        method: 'post',
        data
    });
  }
  //学校用户详情
export function getSchoolById(fOrgId) {
    const data = {
        fOrgId
    };
    return fetch({
        url: '/OrgAccount/getSchoolById',
        method: 'post',
        data
    });
  }
    //经销商用户详情
export function getAgentById(fOrgId) {
    const data = {
        fOrgId
    };
    return fetch({
        url: '/OrgAccount/getAgentById',
        method: 'post',
        data
    });
  }
  //学校负责人详情
export function querySchoolOwner(schoolId) {
    const params = {
        schoolId
    };
    return fetch({
        url: '/school/querySchoolOwner',
        method: 'get',
        params
    });
  }
  //经销商区域详情
export function findAgentAreaByOrgUserId(orgUserId) {
    const data = {
    };
    return fetch({
        url: '/agent/findAgentAreaByOrgUserId/'+orgUserId,
        method: 'post',
        data
    });
  }

  //积分管理

//查询用户金额明细类目
export function listCashType() {
    const data = {
    };
    return fetch({
        url: '/balanceScore/listCashType',
        method: 'post',
        data
    });
  }
  //查询用户积分明细类型
export function listScoreType(kind) {
    const data = {
        kind
    };
    return fetch({
        url: '/balanceScore/listScoreType',
        method: 'post',
        data
    });
  }
  //查询用户当前余额
export function getUserCash(userId) {
    const data = {
        userId
    };
    return fetch({
        url: '/balanceScore/getUserCash',
        method: 'post',
        data
    });
  }
  //查询用户当前积分
export function getUserPoint(userId) {
    const data = {
        userId
    };
    return fetch({
        url: '/balanceScore/getUserPoint',
        method: 'post',
        data
    });
  }
  //分页查询用户余额
export function pagePayCashDetail(page,rows,userId,startTime,endTime,status,flowNum,type,payType) {
    const data = {
        page,
        rows,
        userId,
        startTime,
        endTime,
        status,
        flowNum,
        type,
        payType
    };
    return fetch({
        url: '/balanceScore/pagePayCashDetail',
        method: 'post',
        data
    });
  }
//分页查询用户积分明细
export function pageUserScoreDetail(page,rows,userId,startTime,endTime,kind,flowNum,type,payType) {
    const data = {
        page,
        rows,
        userId,
        startTime,
        endTime,
        kind,
        flowNum,
        type,
        payType
    };
    return fetch({
        url: '/balanceScore/pageUserScoreDetail',
        method: 'post',
        data
    });
  }
//分页查询用户礼物明细
export function pageUserGiftDetail(page,rows,userId,startTime,endTime,type,receiveId) {
    const data = {
        page,
        rows,
        userId,
        startTime,
        endTime,
        receiveId,
        type
    };
    return fetch({
        url: '/balanceScore/pageUserGiftDetail',
        method: 'post',
        data
    });
  }
//导出用户金额明细
export function exportPayCashDetail(userId,startTime,endTime,kind,payType,status,flowNum) {
    const data = {
        userId,
        startTime,
        endTime,
        kind,
        payType,
        status,
        flowNum
    };
    return fetch({
        url: '/balanceScore/exportPayCashDetail',
        method: 'post',
        data
    });
  }
//导出用户积分明细
export function exportUserScoreDetail(userId,startTime,endTime,kind,payType,type,flowNum) {
    const data = {
        userId,
        startTime,
        endTime,
        kind,
        payType,
        type,
        flowNum
    };
    return fetch({
        url: '/balanceScore/exportUserScoreDetail',
        method: 'post',
        data
    });
  }
//导出用户礼物明细
export function exportUserGiftDetail(userId,startTime,endTime,receiveId,type) {
    const data = {
        userId,
        startTime,
        endTime,
        receiveId,
        type
    };
    return fetch({
        url: '/balanceScore/exportUserGiftDetail',
        method: 'post',
        data
    });
  }

  //查询用户当前礼物
export function getUserGift(userId) {
    const data = {
        userId
    };
    return fetch({
        url: '/balanceScore/getUserGift',
        method: 'post',
        data
    });
  }
